<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@page import="sever.*,entity.*,java.util.*,java.text.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
		request.setCharacterEncoding("utf-8");
        int stuno=Integer.parseInt(request.getParameter("stuno"));
		String sname = request.getParameter("sname");
		String sex = request.getParameter("sex");
		String telephone = request.getParameter("telephone");
		String qq = request.getParameter("qq");
		String wechat = request.getParameter("wechat");
		int gradeid = Integer.parseInt(request.getParameter("gradeid"));
		String enterdate = request.getParameter("enterdate");

		String fromcity = request.getParameter("fromcity");
		String birthday = request.getParameter("birthday");
		String address = request.getParameter("address");

		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		Date date1 = sf.parse(enterdate);
		Date date2 = sf.parse(birthday);

		
		
		Student stu = new Student();
		stu.setStuno(stuno);
		stu.setSname(sname);
		stu.setSex(sex);
		stu.setTelephone(telephone);
		stu.setGradeid(gradeid);
		stu.setQq(qq);
		stu.setWechat(wechat);
		stu.setEnterdate(date1);
		stu.setFromcity(fromcity);
		stu.setBirthday(date2);
		stu.setAddress(address);
		
		
		StudentService service = new StudentService();
		int i = service.update(stu);
		out.print(i);
		 if(i>0){
			out.print("信息更新成功");
		}else {
			out.print("更新失败");
		} 
		%>
</body>
</html>